package cn.schoolwow.util.domain.compare.instanceList;

import cn.schoolwow.quickflow.QuickFlowBuilder;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.util.module.compare.instanceList.domain.CompareInstanceListQueryOption;
import cn.schoolwow.util.module.compare.instanceList.service.CompareInstanceListCompositeBusiness;

import java.util.List;

public class CompareInstanceListResponse<T> {
    private FlowContext flowContext;

    public CompareInstanceListResponse(CompareInstanceListQueryOption<T> compareInstanceListQueryOption) {
        flowContext = QuickFlowBuilder.quickFlow().startFlow(new CompareInstanceListCompositeBusiness())
                .putCurrentCompositeFlowData("compareInstanceListQueryOption", compareInstanceListQueryOption)
                .execute();
    }

    /**获取新增列表*/
    public List<T> getAddCompareList(){
        List<T> addCompareList = (List<T>) flowContext.getData("addCompareList");
        return addCompareList;
    }

    /**获取更新列表*/
    public List<UpdateInstanceListCompare<T>> getUpdateInstanceListCompareList(){
        List<UpdateInstanceListCompare<T>> updateInstanceListCompareList = (List<UpdateInstanceListCompare<T>>) flowContext.getData("updateInstanceListCompareList");
        return updateInstanceListCompareList;
    }

    /**获取删除列表*/
    public List<T> getDeleteCompareList(){
        List<T> deleteCompareList = (List<T>) flowContext.getData("deleteCompareList");
        return deleteCompareList;
    }

}
